cleaner php/js library structure