fix github comments and improve code