Some model work, commenting and overall refactoring