added initial migration, optimized repository, added unit tests