reworked variable declarations for better type inference