moved some code around to gather all the lines needed to create a feature in one method.