fixed specs and smells in code