Polish some code and update specs