simplified the code base

Functionality stays the same with less code.