moved some declarations around so I can use it better in another project