Moved variables preprocessing into separate file