refactor for coding style best practices