Refactoring + a lot of stuffs