Moving 'instanceof' operator to its own file