Cleaned up code by removing/merging some str.find()s