minor refactoring; added todos