refactoring & bug fixes