Updated code refactoring and basic layout