total refactoring of pymol stuff