let's use existing functions..
Signed-off-by:Thorsten Eurich <thorsten@eurich.de>
moved db query to subs. 
Signed-off-by:Thorsten Eurich <thorsten@eurich.de>
moved another query to subs.
Signed-off-by:Thorsten Eurich <thorsten@eurich.de>
let's use existing functions.
Signed-off-by:Thorsten Eurich <thorsten@eurich.de>
moved query to subs.
Signed-off-by:Thorsten Eurich <thorsten@eurich.de>
renamed function to match their task.
Signed-off-by:Thorsten Eurich <thorsten@eurich.de>
another query to subs.
Signed-off-by:Thorsten Eurich <thorsten@eurich.de>
unused $db = database();
Signed-off-by:Thorsten Eurich <thorsten@eurich.de>
unused $db = database();
Signed-off-by:Thorsten Eurich <thorsten@eurich.de>
another query to subs.
Signed-off-by:Thorsten Eurich <thorsten@eurich.de>
function renamed, fixed a typo.
Signed-off-by:Thorsten Eurich <thorsten@eurich.de>
Merge pull request #927 from eurich/refact

PM refactoring