More refactoring, sorted out .htaccess