Refactoring & reformatting