Fix enter and some refactoring

Capra!