cleaned up some code, removed some redundant functions

Signed-off-by: Alexander Skjolden <alex@plastboks.net>