more specs and some code clean up