code cleanup

- minor refactoring here & there