refactoring code and plugging in spec sizing