refactoring, comments

Signed-off-by: Sean Nicholls <seannicholls@gmail.com>