some cleanup and function renaming

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