Avoid code duplication

Wow, somebody really screwed up writing notable code :oooo