Code refactors and styling