Trying to make code more regular