Tried to sort out and remove as much unessacery code as possible. Added
lots of usefull functions for teams to reduce replication as well as
ensure everything uses the same method.