remove unused constant
reorganize methods in context and don't set constants if they are already defined