Refactoring + Fixes