Refactoring & layout fixes