changed template implementation
added basic database class
changed regex
small clean up