Technically works, can be DRYer and have more detailed functions.