Moved template file, fixed comments and renamed make_limit_query function