Split out interval into it's own file, include the SQL generation there