Abstract: A method of converting a precompiled source code. The method comprises receiving a precompiled source code of an application, providing a plurality of AST segment patterns each associated with another of a plurality of replacement code templates, building an abstract syntax tree (AST) of the precompiled source code, matching between a first group of the plurality of AST segment patterns and a plurality of AST segments of the AST to identify a second group of the plurality of replacement code templates, the plurality of AST segments are associated with a plurality of source code segments of the precompiled source code, and performing a code migration process of the precompiled source code to a precompiled migrated code of the application using the second group.