refactoring & code cleaning