Moving cast operator to its own file, improved cache for static method calls