Use proper joins instead of multiple tables in FROM clause